package com.firewolf.springcloud;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.Random;

/**
 * 作者：刘兴
 * 时间:19/2/16
 **/
public class AAA {
    public static void main(String[] args) throws  Exception{

       Class.forName("com.mysql.jdbc.Driver");
        Connection connection = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/information_schema","root","root");
        PreparedStatement ps = connection.prepareStatement("show databases");
        ResultSet resultSet = ps.executeQuery();
        while(resultSet.next()){
            String a = resultSet.getString(1);
            System.out.println(a);
        }
    }
}
